// let {proxyAddr} = require('../../config/dev.proxy-table')
export const getWebSocketUrl = () => {
  const webUrl = window.location.origin + window.location.pathname
  const hostname = window.location.hostname
  const protocol = location.protocol === 'https:' ? 'wss://' : 'ws://'
  console.log('protocol: ' + protocol)
  const wsPreUrl = protocol + hostname
  // 无nginx
  const wsSufUrl1 = ':8081/websocket/'
  // 存在nginx
  const wsSufUrl2 = '/websocket/'
  const realWsSufUrl = (webUrl.indexOf('localhost') !== -1 || webUrl.indexOf('127.0.0.1') !== -1) ? wsSufUrl1 : wsSufUrl2
  const websocketUrl = wsPreUrl + realWsSufUrl
  console.log('websocketUrl: ' + websocketUrl)
  return websocketUrl
}
// 测试连接233 nginx
// const flowServiceAddr = 'http://192.168.0.233/lmwy-kebao/flow'
// 用户
const userAction = {
  login: 'login',
  logout: 'logout',
  // 保存用户信息公钥
  // zhirui888
  publicKey: '76269F838694DBD8CA1CF28853C09F8E',
  // zhirui_warehouse
  privateKey: 'E9CDFD7AF3CF33C84DCF2EDB7C930C08',
  // 时间戳
  timestamp: '2E9DF6505C8DE1EA',
  submuenIdex: 1
}
// 权限
const permAction = {
  save: 'savePerm',
  muenPermision: 'BB3EB116C1C133E1E475E5B8D209C158', // 菜单权限
  muenButton: '6CBFD1275C78F3D71B4ABE552E3986B7' // button权限

}
export {
  userAction,
  permAction
}
